using System;
using System.Collections.Generic;
using System.Text;

namespace UTSwindles
{
    public class Utilities
    {
        public static int getInt32(Object value)
        {
            try
            {
                return Convert.ToInt32(value);
            }
            catch (Exception ex)
            {
                return 0;
            }

        }

        public static string getString(Object value)
        {
            try
            {
                return Convert.ToString(value);
            }
            catch (Exception ex)
            {
                return string.Empty;
            }

        }

        public static decimal getDecimal(Object value)
        {
            try
            {
                return Convert.ToDecimal(value);
            }
            catch (Exception ex)
            {
                return 0.0M;
            }

        }

        public static DateTime getDateTime(Object value)
        {
            try
            {
                return Convert.ToDateTime(value);
            }
            catch (Exception ex)
            {
                return DateTime.MinValue;
            }

        }

        public static bool getBoolean(Object value)
        {
            try
            {
                return Convert.ToBoolean(value);
            }
            catch (Exception ex)
            {
                return false;
            }

        }

        public static float getFloat(string value)
        {
            try
            {
                return float.Parse(value);
            }
            catch (Exception ex)
            {
                return float.Parse("0");
            }

        }
    }
}
